/* 
	store.js专门用于暴露一个store对象，整个应用只有一个store对象
*/

//引入createStore，专门用于创建redux中最为核心的store对象
import {createStore,applyMiddleware} from 'redux'
//引入汇总之后的reducer  即reducers下面的index.js
import reducer from './reducers'
//引入redux-thunk，用于支持异步action
import thunk from 'redux-thunk'
//引入redux-devtools-extension 开发者工具 需要yarn add redux-devtools-extension
import {composeWithDevTools} from 'redux-devtools-extension'
//下面的不需要了
import personReducer from "../../7_src_react-redux_数据共享版/redux/reducers/person";
import countReducer from "../../7_src_react-redux_数据共享版/redux/reducers/count";

//createStore并暴露store
export default createStore(reducer,composeWithDevTools(applyMiddleware(thunk)))

/*以前没有redux-devtools-extension 开发者工具时
export default createStore(allReducer,applyMiddleware(thunk))*/

/* 以前的combineReducers是放在store.js里的 combineReducers用来汇总reducer  给state赋新变量
combineReducers汇总所有的reducer变为一个总的reducer
const allReducer = combineReducers({
    he:countReducer,   //countReducer的新的state赋值给he  容器将这样用：state.he 在赋值给容器的props
    rens:personReducer  //personReducer的新的state赋值给rens
})
现在把他们迁移到reducer/index.js 里去 */
